import request from '@/utils/request'

export default {
    //获取资源列表
    resourceList(keywords) {
        return request({
            url: `/admin/resources`,
            method: 'get',
            params:{keywords}
        })
    },
    //添加或修改资源
    saveOrUpdateResource(resource) {
        return request({
            url: `/admin/resources`,
            method: 'post',
            data: resource
        })
    }
    ,
    //删除资源
    deleteResource(id) {
        return request({
            url: `/admin/resources/${id}`,
            method: 'delete',
        })
    },
    //隐藏资源
    changeAnonymous(resource) {
        return request({
            url: `/admin/resources`,
            method: 'put',
            data:resource
        })
    }
}